<!DOCTYPE html>
<html>
    <head>
        <title>reverse</title>
    </head>
    <body>
        <div id="a">
            123
            <span style="background-color: pink;">456789</span>
            0123456789
        </div>
    </body>

    <script>
        let range = new Range();
        range.setStart(document.getElementById("a").childNodes[0], 3);
        range.setEnd(document.getElementById("a").childNodes[2], 3);

        
    </script>
</html>